package threading;

import java.util.concurrent.BlockingDeque;
import java.util.concurrent.LinkedBlockingDeque;

/**
 * @author krystal
 * @date 2022/11/25 8:56
 */
public class Demo22 {
    public static void main(String[] args) throws InterruptedException {
        BlockingDeque<Integer> blockingDeque=new LinkedBlockingDeque<>(100);

        //带有阻塞功能的入队列
        blockingDeque.put(1);
        blockingDeque.put(2);
        blockingDeque.put(3);

        Integer ret=blockingDeque.take();
        System.out.println(ret);
        ret=blockingDeque.take();
        System.out.println(ret);
        ret=blockingDeque.take();
        System.out.println(ret);
    }
}
